<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
        <button @click="list.push(99)">添加元素</button>
        <button @click="list.shift()">删除元素</button>
        <button @click="list.reverse()">反转元素</button>

        <!-- <button @click="list[0] = 999">通过下标改</button> -->
        <p>{{ list }}</p>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: '#app',
        data () {
          return {
            list: [10,20,30]
          }
        },
        watch: {
            list () {
                console.log('数组改变了')
            }
        }
      })
    </script>
  </body>
</html>